<template>
  <div class="app-container">
    <div class="box">
      <el-input
        type="textarea"
        :rows="2"
        placeholder="请输入内容"
        v-model="inKey"
      >
      </el-input>
      <el-button size="mini" type="danger" @click="handleEncrypt">
        加密</el-button
      >
      <el-button size="mini" type="success" @click="handleDecrypt">
        解密</el-button
      >
    </div>
    <p class="key-p">{{Outkey}}</p>
  </div>
</template>
<script>
export default {
  data() {
    return {
      Outkey: "",
      inKey:''
    };
  },
  watch: {},
  created() {},
  methods: {
    handleEncrypt() {
      this.$req.get('System/GetEncrypt',{Mkey:this.inKey}).then((res)=>{
          this.Outkey=res.Data;
      });
    },
      handleDecrypt() {
      this.$req.get('System/GetDecrypt',{Mkey:this.inKey}).then((res)=>{
          this.Outkey=res.Data;
      });
    }
  }
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.box {
  width: 50%;
}
.box .el-textarea {
}
.box .el-button {
  margin-top: 10px;
}
.key-p {
  width: 50%;
  margin-top: 20px;
}
</style>
